/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Provisioning.Result;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.ldap.Check;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.message.CheckHostnameResolveRequest;
/*    */ import com.zimbra.soap.admin.message.CheckHostnameResolveResponse;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class CheckHostnameResolve
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 44 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/*    */     
/* 46 */     CheckHostnameResolveRequest req = (CheckHostnameResolveRequest)JaxbUtil.elementToJaxb(request);
/* 47 */     String host = req.getHostname().toLowerCase();
/*    */     
/* 49 */     Provisioning.Result r = Check.checkHostnameResolve(host);
/*    */     
/* 51 */     return zsc.jaxbToElement(CheckHostnameResolveResponse.fromCodeMessage(r.getCode(), r.getMessage()));
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 58 */     notes.add("Do not need any right, all admins are allowed.");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/CheckHostnameResolve.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */